package com.cxyxj.beandemo.impl;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportResource;

/**
 * @author: gongj
 * @create: 2022-01-27 10:22
 */
@ImportResource
@Import(ProductServiceImpl.class)
public class UserServiceImpl {

    public String name;
    public String email;

    public UserServiceImpl(String name, String email) {
        this.name = name;
        this.email = email;
    }

    public UserServiceImpl() {
    }

    public UserServiceImpl(String name) {
        this.name = name;
    }

    public void initMethod2(){
        System.out.println("UserServiceImpl = initMethod2");
    }


    public void shutdown(){
        System.out.println("UserServiceImpl = destroyMethod2");
    }


    @Bean
    public static ProductServiceImpl p(){
        return new ProductServiceImpl();
    }
}
